<template>
  <div>
    <div class="main">
      <Navbar @select="select" />
      <div class="statistics">
        <component :is="componentId"></component>
      </div>
    </div>
  </div>
</template>

<script>
import Navbar from "./common/Navbar.vue";
import SharedResources from "./common/SharedResources.vue";
import SharedServices from "./common/SharedServices.vue";
import UseOfInformation from "./common/UseOfInformation.vue";
import UserAccess from "./common/UserAccess.vue";
export default {
  name: "Statistics",
  components: {
    Navbar,
    SharedResources,
    SharedServices,
    UseOfInformation,
    UserAccess,
  },
  data() {
    return {
      componentId: "SharedResources",
      components: [
        {
          name: "SharedResources",
          title: "共享资源",
        },
        {
          name: "SharedServices",
          title: "共享服务",
        },
        {
          name: "UseOfInformation",
          title: "信息使用",
        },
        {
          name: "UserAccess",
          title: "用户访问",
        },
      ],
    };
  },
  methods: {
    select(i) {
      console.log(i);
      this.componentId = this.components[i].name;
    },
  },
};
</script>

<style lang="less" scoped>
.main {
  background: #001636;
  ::-webkit-scrollbar {
    display: none;
  }
}
::-webkit-scrollbar {
  display: none;
}
.statistics {
  padding: 20px 20px 10px 20px;
}
</style>
